install! 'cocoapods',
  :disable_input_output_paths => true,
  :generate_multiple_pod_projects => true,
  # :warn_for_unused_master_specs_repo => false,
  :warn_for_multiple_pod_sources => false,
  :deterministic_uuids => false


platform :ios, '9.0'
inhibit_all_warnings!


def mars_pod
  source 'https://cdn.cocoapods.org/'
  source 'https://github.com/volcengine/volcengine-specs.git'
  pod 'VEKit', '22.6.13', :subspecs => [
    'OneKit',
    'VECampaign',
    'VEH5Kit',
    'VEAppUpdateHelper',
    'VEInstall',
    'VERemoteConfig',
    'VESafeKeyboard',
    'RangersAppLog',
    'RangersAPM',
    'RARegisterKit',
    'BDHotfix',
    'Timor'
  ]
    
  pod 'VEKitDemo', :subspecs => [
    'UITask',
    'OneKit',
    'VECampaign',
    'VEH5Kit',
    'VEAppUpdateHelper',
    'VEInstall',
    'VERemoteConfig',
    'VESafeKeyboard',
    'RangersAppLog',
    'RangersAPM',
    'BDHotfix',
    'Timor'
  ]
  
  # pod 'WCDBOptimizedSQLCipher',:git => 'https://github.com/lilidan/sqlcipher.git', :branch => 'sm4'

end

def ov_pod
end

def cn_pod

end

target 'Template_InHouse' do
  ov_pod
  mars_pod
end


def update_deployment_config(config = nil)
  return if config.nil?
  config.build_settings['ENABLE_BITCODE'] = 'NO'
  if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0
    config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
  end
end

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    update_deployment_config(config)
  end

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      update_deployment_config(config)
    end
  end
  ## for generate_multiple_pod_projects = true
  installer.generated_projects.each do |project|
    project.build_configurations.each do |config|
      update_deployment_config(config)
    end

    project.targets.each do |target|
      target.build_configurations.each do |config|
        update_deployment_config(config)
      end
    end
  end

end
